<?php

use yii\helpers\Html;


/* @var $this yii\web\View */
/* @var $model backend\modules\pooai\models\ZpooaiPages */

$this->title = Yii::t('app', '修改页面配置');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', '官网页面管理'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('@web/css/admin.css');
$this->registerCssFile('@web/css/jquery.dad.css');
$this->registerJsFile('@web/js/jquery.dad.min.js');
?>
<div class="zpooai-pages-create" style="background-color: white;width: 100%;height: 100%;">
    <div class="zpooai-pages-form" >
        <div class="nav-ul-li">
            <ul class="nav-ul">
                <li class="nav-li nav-li-active" style="margin-left:0px !important;">
                    <a id="aPage01" data-toggle="tab"><i class="glyphicon glyphicon-th-large"></i>基本信息</a>
                </li>
                <li class="nav-li">
                    <a id="aPage02" data-toggle="tab"><i class="glyphicon glyphicon-edit"></i>文章编辑</a>
                </li>
                <li class="nav-li">
                    <a id="aPage03" data-toggle="tab"><i class="fa fa-file-image-o"></i>插入图片</a>
                </li>
            </ul>
        </div>

        <div class="page-data-form" >
            <?= $this->render('_form', [
                'model' => $model,
                'ZpooaiGallImages'=>$ZpooaiGallImages,
                'ZpooaiArtical'=>$ZpooaiArtical
            ]) ?>
        </div>
    </div>
</div>

<script>
    $('.nav-li').mouseover(function(){
        $(this).css('background-color','rgb(250,250,250)')
    });
    $('.nav-li').mouseout(function(){
        $(this).css('background-color','rgb(245,245,245)')
    });
    $('.nav-li').click(function(){
        $('.nav-li').removeClass('nav-li-active');
        $(this).addClass('nav-li-active');

        var pageNumber = $(this).children()[0].id;
        if(pageNumber=='aPage01') {
            $('.FormPage03').css("display","none");
            $('.FormPage02').css("display","none");
            $('.FormPage01').css("display","block");

        }  else if(pageNumber=="aPage02"){
            $('.FormPage03').css("display","none");
            $('.FormPage02').css("display","block");
            $('.FormPage01').css("display","none");

        } else if(pageNumber=="aPage03"){
            $('.FormPage03').css("display","block");
            $('.FormPage02').css("display","none");
            $('.FormPage01').css("display","none");

        }
    });

    /**
     * 图片排序Ajax请求
     */
    function toPostAjax(conArray)
    {
        conArray = JSON.stringify(conArray);
        console.log(conArray)
        $.ajax({
            url: '?r=pooai/zpooaigallimages/sort',
            type: 'post',
            data: conArray,
            success: function (data) {
                // do something
            }
        });
    }
</script>

